<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>登录页面 - 时光草堂</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="时光草堂">
    <meta name="description" content="时光草堂是一个后台管理系统的HTML模板，基于Bootstrap v4.4.1。">
    <meta name="author" content="青青">
    <link href="static/css/login.css" rel="stylesheet">
    <style>
        .login-form .has-feedback {
            position: relative;
        }
        .login-form .has-feedback .form-control {
            padding-left: 36px;
        }
        .login-form .has-feedback .mdi {
            position: absolute;
            top: 0;
            left: 0;
            right: auto;
            width: 36px;
            height: 36px;
            line-height: 36px;
            z-index: 4;
            color: #dcdcdc;
            display: block;
            text-align: center;
            pointer-events: none;
        }
        .login-form .has-feedback.row .mdi {
            left: 15px;
        }
        .login-form .form-group:last-child,
        .login-right p:last-child {
            margin-bottom: 0px;
        }
        .login-right {
            background: #67b26f!important;
            background: -moz-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            background: -webkit-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            background: linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#67b26f', endColorstr='#4ca2cd', GradientType=1 )!important;
        }
        .login-box {
            max-width: 700px;
        }
        .login-right {
            max-width: 50%;
        }
    </style>
</head>

<body class="center-vh" style="background-image: url(static/images/login-bg-3.jpg); background-size: cover;">
<div class="bg-translucent p-2">
    <div class="flex-box bg-white login-box">
        <div class="login-left p-5">
            <div class="text-center mb-3 d-sm-none" style="width: 165px;height: 165px" >
                <a href="index.html"> <img style="border-radius: 50%;width: 100%"  src="image/logo-sidebar.jpg"> </a>
            </div>
            <form id="form" action="#!" method="post" class="login-form" onsubmit="return false">
                <div class="form-group has-feedback">
                    <span class="mdi mdi-account" aria-hidden="true"></span>
                    <input type="text" class="form-control" autocomplete="false" id="username" value="admin" placeholder="用户名">
                </div>

                <div class="form-group has-feedback">
                    <span class="mdi mdi-lock" aria-hidden="true"></span>
                    <input type="password" class="form-control" id="password" value="123123" placeholder="密码">
                </div>

                <div class="form-group has-feedback row">
                    <div class="col-7">
                        <span class="mdi mdi-check-all form-control-feedback" aria-hidden="true"></span>
                        <input type="text" name="captcha" class="form-control" placeholder="验证码">
                    </div>
                    <div class="col-5 text-right">
                        <img src="images/captcha.png" class="pull-right" id="captcha" style="cursor: pointer;" onclick="this.src=this.src+'?d='+Math.random();" title="点击刷新" alt="captcha">
                    </div>
                </div>

                <div class="form-group">
                    <div class="custom-control custom-checkbox">
                        <input type="checkbox" class="custom-control-input" id="rememberme">
                        <label class="custom-control-label not-user-select" for="rememberme">5天内自动登录</label>
                    </div>
                </div>

                <div class="form-group">
                    <button class="btn btn-block btn-primary" type="submit" onclick="login()">立即登录</button>
                </div>
            </form>
        </div>
        <div class="login-right p-5 d-none d-sm-block">
            <p class="text-white">要做什么之前都请登录</p>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/jquery-3.5.1.js"></script>
<script type="text/javascript">

    function login(){
        $.ajax({
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/sso/user/login" ,
            data: $('#form').serialize(),
            success: function (res) {
                console.log(res);//打印服务端返回的数据(调试用)
                if (res.code === 200) {
                }
            },
            error : function() {
                alert("异常！");
            }
        });
    }



</script>
</body>
</html>